package com.sinosoft.tcmcp.system.web.dto;

import com.sinosoft.framework.core.api.domain.UserEntity;
import com.sinosoft.framework.core.common.utils.ajax.ObjectUtil;

/**
 * 用户信息传输类
 * @author xiaoxiong
 *
 */
public class UserData implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	
	private String username;	//	用户帐号
	private String aid;	//	应用编号
	private String iid;	//	身份信息编号
	private String readonly;	//	只读标识
	private String nickname;	//	昵称
	private String state;	//	状态
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getAid() {
		return aid;
	}
	public void setAid(String aid) {
		this.aid = aid;
	}
	public String getIid() {
		return iid;
	}
	public void setIid(String iid) {
		this.iid = iid;
	}
	public String getReadonly() {
		return readonly;
	}
	public void setReadonly(String readonly) {
		this.readonly = readonly;
	}
	public String getNickname() {
		return nickname;
	}
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}

	/**
	 * 数据转换
	 * 实体类转传输类
	 * @param userEntity	用户实体数据
	 */
	public void toUserData(UserEntity userEntity) {
		ObjectUtil.oldToNew(this, userEntity, "serialVersionUID");
	}
	
	/**
	 * 数据转换
	 * 传输类转实体类
	 * @return	用户实体数据
	 */
	public UserEntity toUserEntity() {
		UserEntity userEntity = new UserEntity();
		ObjectUtil.oldToNew(userEntity, this, "serialVersionUID");
		return userEntity;
	}
}
